﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

namespace BaoJian.Control.local
{
    public partial class Doctor : System.Web.UI.UserControl
    {
        public int Count;
        public string ColumnID;
        public string Region;
        public int TitleLength = 10;

        public string OutDivCSS;
        public string PicDivCSS;
        public string TitleDivCSS;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                string Sql = "SELECT top {0} oid as ID,PID,LEFT(Title,{1}) as Title,REPLACE(FirstSmallImage,'~','') AS ImagePath  FROM doc WHERE pid='{2}' AND Region='{3}' AND Recommand='1' AND FirstSmallImage != '' AND Publish=1 ORDER BY CTime desc";
                Sql = string.Format(Sql, Count, TitleLength, ColumnID, Region);
                DataSet ds = Maticsoft.DBUtility.DbHelperSQL.Query(Sql);
                Repeater1.DataSource = ds.Tables[0];
                Repeater1.DataBind();
            }
        }
    }
}